let t = require;
let  e = module
let  o =  e.exports;
 o.default =  e.exports;

                'use strict';
                console.log("start"),
                    Object.defineProperty(o, '__esModule', {
                        value: !0
                    }),
                    (o.SoundMrg = o.SoundType = void 0);
                var n,
                    i = t('MathUtils');
                (function(t) {
                    (t[(t.Audio = 0)] = 'Audio'), (t[(t.Music = 1)] = 'Music');
                })((n = o.SoundType || (o.SoundType = {})));
                var r = (function() {
                    function t() {}
                    return (
                        Object.defineProperty(t, 'musicVolume', {
                            get: function get() {
                                return this._musicVolume;
                            },
                            set: function set(t) {
                                var e = i.default.clamp(t, 0, 1);
                                (this._musicVolume = e),
                                this._music && (this._music.volume = e);
                            },
                            enumerable: !1,
                            configurable: !0
                        }),
                        Object.defineProperty(t, 'audioVolume', {
                            get: function get() {
                                return this._audioVolume;
                            },
                            set: function set(e) {
                                var o = i.default.clamp(e, 0, 1);
                                for (var n in ((this._audioVolume = o), t.sounds)) {
                                    t.sounds[n].volume = o;
                                }
                            },
                            enumerable: !1,
                            configurable: !0
                        }),
                        (t.click = function() {
                            this.playAudio(this.CLICK);
                        }),
                        (t.mainMusic = function() {
                            this.playMusic(t.MUSIC);
                        }),
                        (t.battleMusic = function() {
                            this.playMusic(t.BATTLE);
                        }),
                        (t.initSound = function(e, o) {
                            if (null != o) {
                                var n = new cc.AudioSource();
                                (n.clip = o), (t.sounds[e] = n);
                            }
                        }),
                        (t.getAudioClip = function(e) {
                            return t.sounds[e] ? t.sounds[e].clip : null;
                        }),
                        (t.getEmptyAudioSource = function() {
                            var e;
                            for (var o in t.sounds) {
                                if (!(e = t.sounds[o]).isPlaying) return e;
                            }
                            return (e = new cc.AudioSource()), t.sounds.push(e), e;
                        }),
                        (t.play = function(e, o, i) {
                            void 0 === o && (o = !1);
                            var r = i == n.Music ? this._music : this.getEmptyAudioSource();
                            cc.resources.load(e, cc.AudioClip, function(e, a) {
                                e
                                    ?
                                    cc.error(e.message || e) :
                                    ((r.clip = a),
                                        (r.loop = o),
                                        r.play(),
                                        i == n.Music && (t._musicUrl = a.nativeUrl));
                            });
                        }),
                        (t.playAudio = function(e) {
                            void 0 === e && (e = t.CLICK),
                                this._audioVolume > 0 && t.play('Sounds/' + e, !1, n.Audio);
                        }),
                        (t.stopAudio = function() {
                            for (var e in t.sounds) {
                                t.sounds[e].stop();
                            }
                        }),
                        (t.playMusic = function(e) {
                            void 0 === e && (e = t.MUSIC),
                                null == this._music && (this._music = new cc.AudioSource());
                            var o = 'Sounds/' + e;
                            (this._music.volume = this._musicVolume),
                            (null == this._music.clip ||
                                (this._music.clip && o != this._musicUrl)) &&
                            ((this._musicUrl = o), t.play(o, !0, n.Music));
                        }),
                        (t.stopMusic = function() {
                            this._music && this._music.stop();
                        }),
                        (t.pauseMusic = function() {
                            this._music && (this._music.pause(), (this._isPause = !0));
                        }),
                        (t.resumeMusic = function() {
                            this._isPause &&
                                (this._music && this._music.resume(), (this._isPause = !1));
                        }),
                        (t.CLICK = 'click'),
                        (t.MUSIC = 'mainMusic'),
                        (t.BATTLE = 'battleMusic'),
                        (t.sounds = []),
                        (t._isPause = !1),
                        (t._musicVolume = 1),
                        (t._audioVolume = 1),
                        (t._mute = !1),
                        t
                    );
                })();
                (o.SoundMrg = r), console.log("end");
            module.exports =  e.exports;